import React from "react";
import { createRoot } from 'react-dom/client';
import i18n from "i18next";
import { Select, Space } from 'antd';
import { useTranslation, initReactI18next } from "react-i18next";
function Index() {
   const { t , i18n } = useTranslation();
   const handleChange = value => {
  console.log(`selected ${value}`);
i18n.changeLanguage(value);
};
  return (
    <div>
      <Select
      defaultValue="en"
      style={{ width: 120 }}
      onChange={handleChange}
      options={[
        { value: 'en', label: '英文' },
        { value: 'zh', label: '中文' },
      ]}
    />
     <h2>{t('Welcome to React')}</h2>;
     <h2>肥嘟嘟发过火金黄金黄</h2>
    </div>
  )
}

export default Index
